/*
 * @Descripttion:
 * @LastEditors: xzh
 * @LastEditTime: 2024-05-10 23:25:28
 */
import request from "@/utils/request";
import { object_Inf } from "@/utils/typings/index.type";
import User_Api from "../app/users";

/**
 * @Author: xzh
 * @Descripttion:Dashboard 接口类
 * @Param:
 */
export default class dashboard_APi extends User_Api {
  //#region 设备Dashboard
  /**
   * @Author: xzh
   * @Descripttion: 获取设备仪表板接口
   * @Param:
   */
  static getShapingEquipDashboard = (): Promise<Array<object_Inf>> =>
    request({
      url: "/api/EquipmentDashboard/GetEquipmentDashboard",
      method: "get",
      params: {},
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取设备Dashboard
   * @Param:
   * @param {*} Promise
   */
  static getEquipDashboard = (): Promise<object_Inf> =>
    request({
      url: "/api/EquipmentDashboard/GetEquipmentDashboard1",
      method: "get",
      params: {},
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取Esg电能表数据
   * @Param:
   */
  static getEsgElectricEquipData = (
    data: object_Inf
  ): Promise<Array<object_Inf>> =>
    request({
      url: "/api/Statistics/GetEMPointStatisticsList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 导出Esg电能表数据
   * @Param:
   */
  static exportEsgElectricEquipData = (
    data: object_Inf
  ): Promise<Array<object_Inf>> =>
    request({
      url: "/api/Statistics/ExportEMPointStatisticsList",
      method: "post",
      data,
      responseType: "blob",
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取Esg流量计数据
   * @Param:
   */
  static getEsgFlowmeterEquipData = (
    data: object_Inf
  ): Promise<Array<object_Inf>> =>
    request({
      url: "/api/Statistics/GetFMPointStatisticsList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 导出Esg流量计数据
   * @Param:
   */
  static exportEsgFlowmeterEquipData = (
    data: object_Inf
  ): Promise<Array<object_Inf>> =>
    request({
      url: "/api/Statistics/ExportFMPointStatisticsList",
      method: "post",
      data,
      responseType: "blob",
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取成型机数据
   * @Param:
   */
  static getShapingEquipData = (data: object_Inf): Promise<Array<object_Inf>> =>
    request({
      url: "/api/Statistics/GetFormingPointStatisticsList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 导出成型机数据
   * @Param:
   */
  static exporShapingEquipData = (
    data: object_Inf
  ): Promise<Array<object_Inf>> =>
    request({
      url: "/api/Statistics/ExportFormingPointStatisticsList",
      method: "post",
      data,
      responseType: "blob",
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取1311设备数据
   * @Param:
   */
  static getOtherEquipData = (data: object_Inf): Promise<Array<object_Inf>> =>
    request({
      url: "/api/Statistics/GetOtherPointStatisticsList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 导出1311设备数据
   * @Param:
   */
  static exporOtherEquipData = (data: object_Inf): Promise<Array<object_Inf>> =>
    request({
      url: "/api/Statistics/ExportOtherPointStatisticsList",
      method: "post",
      data,
      responseType: "blob",
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取当日切边机数据
   * @Param:
   */
  static getSideCutEquipData = (data: object_Inf): Promise<Array<object_Inf>> =>
    request({
      url: "/api/Statistics/GetTrimPointStatisticsList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 导出当日切边机数据
   * @Param:
   */
  static exporSideCutEquipData = (
    data: object_Inf
  ): Promise<Array<object_Inf>> =>
    request({
      url: "/api/Statistics/ExportIrimPointStatisticsList",
      method: "post",
      data,
      responseType: "blob",
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 导出excel
   * @Param:
   */
  static exportFile = (): Promise<Array<object_Inf>> =>
    request({
      url: "/api/EquipmentDashboard/ExportFile",
      method: "get",
      responseType: "blob",
      headers: {
        "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
      },
    });
  //#endregion

  //#region 模具Dashboard
  /**
   * @Author: xzh
   * @Descripttion: 获取模具仪表板接口
   * @Param:
   */
  static getMoldDashboard = (): Promise<object_Inf> =>
    request({
      url: "/api/MouldDashboard/GetMouldDashboard",
      method: "get",
      params: {},
    });
  //#endregion

  //#region 生产Dashboard
  /**
   * @Author: xzh
   * @Descripttion: 获取生产仪表板接口
   * @Param:
   */
  static getProduceDashboard = (): Promise<object_Inf> =>
    request({
      url: "/api/ProductionDashboard/GetProductionDashboard",
      method: "get",
      params: {},
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取生产AOI良率
   * @Param:
   * @param {object_Inf} data
   */
  static getProduceAOIYieldRate = (data: object_Inf): Promise<object_Inf> =>
    request({
      url: "/api/ProductionDashboard/GetAOIYieldRate",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取生产AOI不良率
   * @Param:
   * @param {object_Inf} data
   */
  static getProduceAOINotYieldRate = (data: object_Inf): Promise<object_Inf> =>
    request({
      url: "/api/ProductionDashboard/GetAOIBadRate",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取生产AOI检验数
   * @Param:
   * @param {object_Inf} data
   */
  static GetProduceAOIInspection = (data: object_Inf): Promise<object_Inf> =>
    request({
      url: "/api/ProductionDashboard/GetAOIInspectionDto",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取生产产出量
   * @Param:
   * @param {object_Inf} data
   */
  static getProduceOutputDto = (data: object_Inf): Promise<object_Inf> =>
    request({
      url: "/api/ProductionDashboard/GetOutputDto",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取生产能耗
   * @Param:
   * @param {object_Inf} data
   */
  static getProducetEnergy = (data: object_Inf): Promise<object_Inf> =>
    request({
      url: "/api/ProductionDashboard/GetEnergyConsumptionDto",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取稼动率
   * @Param:
   * @param {object_Inf} data
   */
  static getProducetRate = (data: object_Inf): Promise<object_Inf> =>
    request({
      url: "/api/ProductionDashboard/GetUtilizationRateDto",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取使用率
   * @Param:
   * @param {object_Inf} data
   */
  static getUsageRateDto = (data: object_Inf): Promise<object_Inf> =>
    request({
      url: "/api/ProductionDashboard/GetUsageRateDto",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取生成AOI推移图
   * @Param:
   * @param {object_Inf} data
   */
  static getProducetAOITrendChart = (data: object_Inf): Promise<object_Inf> =>
    request({
      url: "/api/ProductionDashboard/GetAOIRunChart",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取生成AllAOI推移图
   * @Param:
   * @param {object_Inf} data
   */
  static getProducetAllAOITrendChart = (
    data: object_Inf
  ): Promise<object_Inf> =>
    request({
      url: "/api/ProductionDashboard/GetAllAOIRunChart",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取生成产出推移图
   * @Param:
   * @param {object_Inf} data
   */
  static getProducetOutputTrendChart = (
    data: object_Inf
  ): Promise<object_Inf> =>
    request({
      url: "/api/ProductionDashboard/GetEquipmentOutputRunChart",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取生成All产出推移图
   * @Param:
   * @param {object_Inf} data
   */
  static getProducetAllOutputTrendChart = (
    data: object_Inf
  ): Promise<object_Inf> =>
    request({
      url: "/api/ProductionDashboard/GetAllEquipmentOutputRunChart",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取生成稼动率推移图
   * @Param:
   * @param {object_Inf} data
   */
  static getProducetUtilizeRateTrendChart = (
    data: object_Inf
  ): Promise<object_Inf> =>
    request({
      url: "/api/ProductionDashboard/GetEquipmentUtilizationRateRunChart",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取生成All稼动率推移图
   * @Param:
   * @param {object_Inf} data
   */
  static getProducetAllUtilizeRateTrendChart = (
    data: object_Inf
  ): Promise<object_Inf> =>
    request({
      url: "/api/ProductionDashboard/GetAllEquipmentUtilizationRateRunChart",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取生成使用率推移图
   * @Param:
   * @param {object_Inf} data
   */
  static getProducetUseRateTrendChart = (
    data: object_Inf
  ): Promise<object_Inf> =>
    request({
      url: "/api/ProductionDashboard/GetUsageRateRunChart",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取生成All使用率推移图
   * @Param:
   * @param {object_Inf} data
   */
  static getProducetAllUseRateTrendChart = (
    data: object_Inf
  ): Promise<object_Inf> =>
    request({
      url: "/api/ProductionDashboard/GetAllUsageRateRunChart",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  //#endregion

  //#region 售服Dashboard
  /**
   * @Author: xzh
   * @Descripttion: 获取售服仪表板接口
   * @Param:
   */
  static getAfterSaleDashboard = (): Promise<object_Inf> =>
    request({
      url: "/api/AfterSaleDashboard/GetAfterSaleDashboard",
      method: "get",
      params: {},
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取售服设备总数统计
   * @Param:
   */
  static getAfterSaleEquipTotalStatistics = async (): Promise<object_Inf> =>
    request({
      url: "/api/AfterSaleDashboard/GetEquipmentOnlineStatistics",
      method: "get",
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取售服设备维修统计
   * @Param:
   */
  static getAfterSaleEquipRepairStatistics = async (): Promise<object_Inf> =>
    request({
      url: "/api/AfterSaleDashboard/GetEquipmentRepairStatistics",
      method: "get",
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取售服设备保养统计
   * @Param:
   */
  static getAfterSaleEquipUpkeepStatistics = async (): Promise<object_Inf> =>
    request({
      url: "/api/AfterSaleDashboard/GetEquipmentMaintenanceStatistics",
      method: "get",
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取售服模具总数统计
   * @Param:
   */
  static getAfterSaleMoldTotalStatistics = async (): Promise<object_Inf> =>
    request({
      url: "/api/AfterSaleDashboard/GetMouldOnlineStatistics",
      method: "get",
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取售服模具维修统计
   * @Param:
   */
  static getAfterSaleMoldRepairStatistics = async (): Promise<object_Inf> =>
    request({
      url: "/api/AfterSaleDashboard/GetMouldRepairStatistics",
      method: "get",
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取售服模具保养统计
   * @Param:
   */
  static getAfterSaleMoldUpkeepStatistics = async (): Promise<object_Inf> =>
    request({
      url: "/api/AfterSaleDashboard/GetMouldMaintenanceStatistics",
      method: "get",
    });
  //#endregion
  /**
   * @Author: xzh
   * @Description:获取dataV信息
   * @Param:
   */
  static getDataVInfo = async (): Promise<object_Inf> =>
    request({
      url: "/api/AfterSaleDashboard/GetDataVInfo",
      method: "get",
    });
}
